<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<title>${appname}-<c:if test="${!empty sessionScope._local_node_session}">${sessionScope._local_node_session.nodeName}-</c:if>${si:ctname("NET_TYPE",sessionScope._netType)}</title>
<%@ include file="/WEB-INF/view/common/css_js_base.jsp"%>
<%@ include file="/WEB-INF/view/common/css_js_ztree.jsp"%>
<script type="text/javascript" src="${ctx}/static/js/lib/nicescroll/jquery.nicescroll.min.js"></script>
<script type="text/javascript">
var setting = {
	view: {
		selectedMulti: false
	},
	check: {
		enable: false
	},
	data: {
		simpleData: {
			enable: true					
		}
	},
	callback: {
		onClick: zTreeOnClick,
		onCollapse: zTreeOnCollapse,
		onExpand: zTreeOnExpand
	}
};
var zNodes = ${depInfoTree};
var zTree;
$(document).ready(function(){
	zTree = $.fn.zTree.init($("#treeDemo"), setting, zNodes);
	autoScrollForZtree();
});

function zTreeOnClick(event, treeId, treeNode){
	if(treeNode.pId != -1){
    	$.ajax({
			   type: "GET",
			   dataType:"html",
			   cache: false,
			   url: _ctx + "/sai/uumsclient/dep_info_detail.do",
			   data: {selectedNodeId:treeNode.id},
			   success: function( content ){
				   $('#data').html( content ); 
			   },
			   error:function(){
				   ui.msg('信息加载错误', 0);
			   }
		});
	}
}

function zTreeOnExpand(event, treeId, treeNode) {
	autoScrollForZtree();
};
function zTreeOnCollapse(event, treeId, treeNode) {
	autoScrollForZtree();
};
function autoScrollForZtree(){
	$("#trzzDiv").niceScroll({touchbehavior:false,cursorcolor:"#3ba5d6",cursoropacitymax:0.6,cursorwidth:10});
}
</script>
<style type="text/css">
/*#trzzDiv {height:320px;overflow-y:scroll;overflow-x:auto;}*/
#trzzDiv {height:50%;overflow-y:scroll;}
</style>
</head>
<body>
<%@ include file="/WEB-INF/view/common/navbar.jsp"%>
<!-- Begin page content -->
<div class="container">
	<div class="row">
		<div class="col-md-3">
			<div class="panel panel-default">
				<!-- <div class="panel-heading">
				&nbsp;
				</div> -->
				<div class="panel-body">
					<div id="trzzDiv">
						<ul id="treeDemo" class="ztree"></ul>
					</div>
				</div>
			</div>
		</div>
		<div class="col-md-9">
			<div class="panel panel-default">
				  <div class="panel-heading">
				        部门信息
				  </div>
				  <div class="panel-body">
				  	<div class="mg-top24" id="data">
					</div>
				  </div>
			</div>
		</div>
	</div>
</div>
<%@ include file="/WEB-INF/view/common/footer.jsp"%>
</body>
</html>
